WORKING-STORAGE SECTION. 77 w-char pic x. 77 w-hex pic x(2). 77 w-8bit pic x(8). PROCEDURE DIVISION. ... move "A" to w-char move function bit-of(w-char) to w-8bit display w-8bit move function bit-to-char(w-8bit) to w-char display w-char display function hex-of(w-char) move "42" to w-hex display function hex-to-char(w-hex) |
function-id. myfunction as "myfunction". working-storage section. 77 myresult pic x(9). linkage section. 77 myparam pic x(5). procedure division using myparam returning myresult. ... string myparam delimited by size "-END" delimited by size into myresult goback. end function myfunction |
configuration section. repository. function myfunction as "myfunction" ... working-storage section. 77 w-par pic x(5). 77 w-res pic x(9). procedure division. ... move function myfunction(my-par) to w-res display $myfunction(mypar) |
configuration section. special-names. currency sign is "USD " with picture symbol "$" currency sign is "EUR " with picture symbol "€" currency sign is "CHF " with picture symbol "F" ... working-storage section. 01 w-price pic 9(4)v99. 01 w-usd-price pic $$,$$$.99. 01 w-eur-price pic €€,€€€.99. 01 w-chf-price pic FF,FFF.99. procedure division. ... move 1234.89 to w-price move w-price to w-usd-price, w-eur-price, w-chf-price display w-usd-price display w-eur-price display w-chf-price |
USD 1,234.89 EUR 1,234.89 CHF 1,234.89 |